<script setup lang="ts">
import micro from '../micro'
// import microApp from '@micro-zoe/micro-app'
const pushMsg = () => {
  // micro.setData('childVueB', {city: 'HK'}, () => {
  //   console.log('数据已经发送完成')
  // })
  micro.setData('childVueB', {city: 'HK'}, () => {
    console.log('数据已经发送完成')
  })
}
</script>
<template>
  <div>
    我是主应用 - infoB
    <hr/>
    <a href="/#/home">首页</a>&nbsp;
    <a href="/#/abount">详情</a>&nbsp;
    <a href="/#/infoB">详情B</a>&nbsp;
    <div>
      <button @click="pushMsg">发送数据给子应用B</button>
    </div>
    <div style="display: flex; justify-content: space-around;">
      <div style="width: 500px; height: 500px; border: 1px solid #000;margin-right:50px;">
        <micro-app name='childVue' url='http://localhost:5888/#/' :data="{name: 'childVue'}" iframe></micro-app>
      </div>
      <div style="width: 500px; height: 500px; border: 1px solid #000;">
        <micro-app name='childVueB' url='http://localhost:5889/#/' :data="{name: 'childVueB'}" iframe></micro-app>
      </div>
    </div>
  </div>
</template>

